package com.song.service.impl;

import com.song.mapper.DeptMapper;
import com.song.pojo.Dept;
import com.song.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {
    @Autowired
    private DeptMapper deptMapper;
    @Override
    public List<Dept> findAllDepts() {
      return deptMapper.getAllDept();
    }
    @Override
    public int deleteDeptById(Integer id) {
        return deptMapper.deleteDeptById(id);
    }
    @Override
    public int addDept(String name) {
        return deptMapper.addDept(name);
    }
    @Override
    public int updateDept(Dept dept) {
        return deptMapper.updateDept(dept);
    }
    @Override
    public Dept getDeptById(Integer id) {
        return deptMapper.getDeptById(id);
    }

}
